package com.wm.yigongfang.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wm.yigongfang.common.entity.BaseEntity;
import com.wm.yigongfang.entity.User;
import com.wm.yigongfang.mapper.UserMapper;
import org.springframework.stereotype.Service;

/**
 * @Author ZhangPeng
 * @Date 2024/3/7 17:25
 * @PackageName:com.wm.yigongfang.dao
 * @ClassName: UserDao
 * @Description: TODO
 */
@Service()
public class UserDao extends ServiceImpl<UserMapper, User> {
    /**
     * 根据wxOpenid查询用户
     *
     * @param wxOpenid
     * @return
     */
    public User findByWXOpenid(String wxOpenid) {
        return lambdaQuery().eq(User::getWxOpenid, wxOpenid).eq(BaseEntity::getIsDelete, 0).one();
    }

}
